int* decode(int* encoded, int encodedSize, int first, int* returnSize) {

	int* arr = (int*)malloc((encodedSize + 1) * sizeof(int));
	arr[0] = first;
	int i = 0;
	for (i = 1; i < encodedSize + 1; i++) {
		arr[i] = encoded[i - 1] ^ arr[i - 1];
	}

	*returnSize = encodedSize + 1;
	return arr;
}